home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
apbsu106.zip
/
FILE-MAN.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-05-30
|
15KB
|
659 lines
start:
' Set up and print intro screen.
cls
print " The ApBASIC File Manager, Version 1.06"
print
print
print " By Matt Roberts
print " 5 Cedar St., # 8
print " Montpelier, Vt 05602-3006
print " (802)223-2553
print
print
print "If you find the files on this disk useful, a donation of $5.00 would be
print "greatly appreciated. Thanks.
print
print
print "If you're having trouble using this program, and the documentation
print "doesn't seem to help, you can call me between 9AM and 9PM EST, and I'll
print "try to help.
print
print
print
gosub presskey
'Opening screen is now set up and printed.
' Now create a menu of options.
menu:
cls
locate 1,35
print "Your options:
print
print
print "1- Work with CONFIG.SYS file. 9- Get time/date."
print
print "2- Work with AUTOEXEC.BAT file. 10-Quit."
print
print "3- Delete files."
print
print "4- Make directory.
print
print "5- Display file contents."
print
print "6- Copy a file."
print
print "7- Get file length."
print
print "8- Move file."
print
print
input "Please press the number of your choice, and then press Enter. ",choice
on choice gosub changecon,chngauto,killfile,makedir,displafl,copyfile,filength,movefile,timedate,quitprog
goto menu
'This is the end of the menu.
'Here is the routine for working with the CONFIG.SYS file.
changecon:
cls
print " View or Change Your CONFIG.SYS File
print
print
input "On which drive is your CONFIG.SYS file";drive$
redrive:
drive$=drive$+"\"
if drive$="a:\" then file1$="a:\config.sys
if drive$="A:\" then file1$="a:\config.sys
if drive$="b:\" then file1$="b:\config.sys
if drive$="B:\" then file1$="b:\config.sys
if drive$="c:\" then file1$="c:\config.sys
if drive$="C:\" then file1$="c:\config.sys
if drive$="d:\" then file1$="d:\config.sys
if drive$="D:\" then file1$="d:\config.sys
if drive$="a:\" then file2$="a:\config.bas
if drive$="A:\" then file2$="a:\config.bas
if drive$="b:\" then file2$="b:\config.bas
if drive$="B:\" then file2$="b:\config.bas
if drive$="c:\" then file2$="c:\config.bas
if drive$="C:\" then file2$="c:\config.bas
if drive$="d:\" then file2$="d:\config.bas
if drive$="D:\" then file2$="d:\config.bas
confmenu:
cls
print "You have the following options:"
print
print
print "1- Just view the CONFIG.SYS file."
print
print "2- Add lines to the end of your file."
print
print "3- Create a new CONFIG.SYS file."
print
print "4- Return to the Main Options Menu."
print
print
print
input "Please press the number corresponding to your choice, and then press Enter. ",chngview$
if chngview$="1" then cls:gosub seesys:goto confmenu
if chngview$="2" then cls:gosub appendln:gosub seesys:goto confmenu
if chngview$="3" then cls:goto newfilec
if chngview$="4" then goto menu
goto confmenu
'This section creates a new CONFIG.SYS file.
newfilec:
cls
open file1$ for input as 1
open file2$ for output as 2
while not eof(1)
line input # 1, a$
print# 2, a$
wend
close # 1
close # 2
kill file1$
print
print
print "Your CONFIG.SYS file has been changed to CONFIG.BAS in order to save it for
print "future use. To use it later, it will have to be renamed to something else
print "(for example, CONFIG.X)."
print
print
print
gosub presskey
changeagn:
cls
open file1$ for output as 1
print "How many files do you want?
input "To quit, press Q and Enter. ",filenumb$
if filenumb$="q" or filenumb$="Q" then goto restorec
print# 1, "files=";filenumb$
print
print
print
input "How many buffers do you want";buffer$
print# 1, "buffers=";buffer$
devcagain:
print
input "Which device would you like to include (N for none)";device$
if device$="n" or device$="N" then goto nodevice
print# 1, "devices=";device$
print
input "Would you like to include more devices";incldmore$
if incldmore$="y" or incldmore$="Y" then goto devcagain
nodevice:
print
input "Do you want Break on or off (if not sure, type OFF)";breakyn$
if breakyn$="on" or breakyn$="ON" then print# 1, "break=on
close # 1
gosub seesys
print
print
print
print "If this is not O.K. AND you want to go back and change the file, press C and
print "then press Enter."
print
print "To restore your original CONFIG.SYS file, press R and Enter.
print
input "If you're happy with it as is, type OK and Enter. ",change$
okdecide:
if change$="c" or change$="C" then goto changeagn
if change$="r" or change$="R" then goto restorec
if change$="ok" or change$="OK" then goto confmenu
print
input "You must choose between C, R, or OK. ",change$:goto okdecide
restorec:
cls
reset
kill file1$
open file2$ for input as 1
open file1$ for output as 2
while not eof(1)
line input # 1, a$
print# 2, a$
wend
reset
print "Your original CONFIG.SYS file has been restored."
gosub presskey
goto confmenu
'This is the end of the routine for working with the CONFIG.SYS file.
' Here is the routine for working with the AUTOEXEC.BAT file.
chngauto:
cls
print " View or Change Your AUTOEXEC.BAT File
print
print
input "On which drive is your AUTOEXEC.BAT file";drive$
redrivea:
drive$=drive$+"\"
if drive$="a:\" then file1$="a:\autoexec.bat"
if drive$="A:\" then file1$="a:\autoexec.bat"
if drive$="b:\" then file1$="b:\autoexec.bat"
if drive$="B:\" then file1$="b:\autoexec.bat"
if drive$="c:\" then file1$="c:\autoexec.bat"
if drive$="C:\" then file1$="c:\autoexec.bat"
if drive$="d:\" then file1$="d:\autoexec.bat"
if drive$="D:\" then file1$="d:\autoexec.bat"
if drive$="e:\" then file1$="e:\autoexec.bat"
if drive$="E:\" then file1$="e:\autoexec.bat"
if drive$="a:\" then file2$="a:\autoexec.bas"
if drive$="A:\" then file2$="a:\autoexec.bas"
if drive$="b:\" then file2$="b:\autoexec.bas"
if drive$="B:\" then file2$="B:\autoexec.bas"
if drive$="c:\" then file2$="c:\autoexec.bas"
if drive$="C:\" then file2$="c:\autoexec.bas"
if drive$="d:\" then file2$="d:\autoexec.bas"
if drive$="D:\" then file2$="d:\autoexec.bas"
if drive$="e:\" then file2$="e:\autoexec.bas"
if drive$="E:\" then file2$="e:\autoexec.bas"
automenu:
cls
print "You have the following options:"
print
print
print "1- Just view the AUTOEXEC.BAT file."
print
print "2- Add lines to the end of your file."
print
print "3- Create a new AUTOEXEC.BAT file."
print
print "4- Return to the Main Options Menu.
print
print
print
input "Please press the number corresponding to your choice, and then press Enter. ",chngauto$
if chngauto$="1" then
cls
gosub autolook
goto automenu
elseif chngauto$="2" then
cls
gosub appndaut
gosub autolook
goto automenu
elseif chngauto$="3" then
cls
goto newauto
elseif chngauto$="4" then
cls
return
else
goto automenu
end if
' This routine creates a new AUTOEXEC.BAT file.
newauto:
cls
open file1$ for input as 1
open file2$ for output as 2
while not eof(1)
line input # 1, a$
print # 2, a$
wend
close # 1
close # 2
kill file1$
cls
print "Your AUTOEXEC.BAT file has been changed to AUTOEXEC.BAS in order to
print "save it for later use. To use it later, you will have to
print "rename it AUTOEXEC.BAT after renaming the current AUTOEXEC.BAT to
print "something else (for example, AUTOEXEC.X)."
print
print
gosub presskey
scndchng:
cls
open file1$ for output as 1
print "Please type the first line you want, then press Enter (Q to quit).
print
input "> ",firstln$
if firstln$="q" then
goto nochange
elseif firstln$="Q" then
goto nochange
end if
print # 1, firstln$
contline:
print
print "Please type your next line, followed by Enter (Q to quit).
print
input "> ",nextline$
if nextline$="q" then
goto stopchng
elseif nextline$="Q" then
goto stopchng
end if
print # 1, nextline$
goto contline
stopchng:
close # 1
cls
gosub autolook
print
print
print
print "If this is not O.K. AND you want to change it, press C and then Enter."
print
print